<template>
	<view class="page">
		<view class="nav nav-wrap">
			<view :class="selected?'yellow':'default'" @tap="selectedFn">全部</view>
			<view :class="selected1?'yellow':'default'" @tap="selected1Fn">云端</view>
			<view :class="selected2?'yellow':'default'" @tap="selected2Fn">本地</view>
			<view class='select_box'>
				<Select :prop-array='selectData' prop-type='name' prop-color='1' @selectClick="selectClick"></Select>
			</view>
		</view>
		<!-- 全部 -->
		<view :class="selected?'show':'hidden'">
			<view class="schoollist">
				<view class="school-list">
					<block v-for="(item,i) in items" :key="i">
						<view class="school-list-item">
							<block v-for="(item_k,k) in 2" :key="k">
								<view v-if="items[i+k] != null && i%2 == 0 " class="school-list-info" :class="!isVerticalScreen ? 'img-size':''"
								 :data-items="items[i+k]" :data-index="i+k" @tap="downraw">
									<image :id="'img'+items[i+k].kid" :class="showId == items[i+k].kid ? 'school-list-photo-Selected':'school-list-photo'"
									 :src="items[i+k].imageContent" />
									<view v-if="items[i+k].state != 1" class="school-list-photo school-list-photo-up">
										<text class="school-list-notLoad">{{items[i+k].state == 0 ?'未下载' : '下载中'}}</text>
									</view>
									<text class="school-list-desc">{{items[i+k].name}}</text>
								</view>
							</block>
						</view>
					</block>
				</view>
			</view>
		</view>

		<!-- 云端 -->
		<view :class="selected1?'show':'hidden'">
			<view class="schoollist">
				<view class="school-list">
					<block v-for="(item,i) in items" :key="i">
						<view class="school-list-item">
							<block v-for="(item_k,k) in 2" :key="k">
								<view v-if="items[i+k] != null && i%2 == 0 " class="school-list-info" :class="!isVerticalScreen ? 'img-size':''"
								 :data-items="items[i+k]" :data-index="i+k" @tap="downraw">
									<image :id="'img'+items[i+k].kid" :class="showId == items[i+k].kid ? 'school-list-photo-Selected':'school-list-photo'"
									 :src="items[i+k].imageContent" />
									<view v-if="items[i+k].state != 1" class="school-list-photo school-list-photo-up">
										<text class="school-list-notLoad">{{items[i+k].state == 0 ?'未下载' : '下载中'}}</text>
									</view>
									<text class="school-list-desc">{{items[i+k].name}}</text>
								</view>
							</block>
						</view>
					</block>
				</view>
			</view>
		</view>

		<!-- 本地 -->
		<view :class="selected2?'show':'hidden'">
			<view class="schoollist">
				<view class="school-list">
					<block v-for="(item,i) in items" :key="i">
						<view class="school-list-item">
							<block v-for="(item_k,k) in 2" :key="k">
								<view v-if="items[i+k] != null && i%2 == 0" class="school-list-info" :class="!isVerticalScreen ? 'img-size':''"
								 :data-items="items[i+k]" :data-index="i+k" @tap="downraw">
									<image :id="'img'+items[i+k].kid" :class="showId == items[i+k].kid ? 'school-list-photo-Selected':'school-list-photo'"
									 :src="items[i+k].imageContent" />
									<view v-if="items[i+k].state != 1" class="school-list-photo school-list-photo-up">
										<text class="school-list-notLoad">{{items[i+k].state == 0 ?'未下载' : '下载中'}}</text>
									</view>
									<text class="school-list-desc">{{items[i+k].name}}</text>
								</view>
							</block>
						</view>
					</block>
				</view>
			</view>
		</view>
		<!-- 互动 -->
		<hudong ref="hudong" :hudongIp="hudongIp"></hudong>
		<!-- 密码校验 -->
		<check-pwd ref="pwd" :localServerIP="localIP"></check-pwd>
		<!-- 控制 -->
		<e-control ref="control"></e-control>
		<!-- 关于 -->
		<about-us ref="about"></about-us>
		<!--bindmenuItemClick为按钮点击的时候的回调方法  mainmodel是显示的按钮，menulist为折叠的菜单的数组数据-->
		<movemenu @menuItemClick="menuItemClick"></movemenu>
	</view>
</template>

<script>
	const app = getApp()

	import http from '../../utils/http.js'
	import websocket from '../../utils/websocket.js';
	import utils from '../../utils/util.js';
	var page = 1;
	var hadLastPage = false;
	var allItems = []; //全部素材
	var cloundList = []; //云端素材
	var localList = []; //本地素材
	var timer = null;
	var materialId = '';

	import hudong from '../../components/hudong/index.vue'
	import checkPwd from '../../components/checkPwd/index.vue'
	import aboutUs from '../../components/about/index.vue'
	import eControl from '../../components/control/index.vue'
	import Select from '../../components/select/select.vue'
	import movemenu from '../../components/movemenu/movemenu.vue'

	export default {
		components: {
			hudong,
			checkPwd,
			aboutUs,
			eControl,
			Select,
			movemenu
		},
		data() {
			return {
				items: [], //素材集合
				userInfo: {},
				scrollTop: 0,
				ip: "",
				state: "-1",
				selected: true,
				selected1: false,
				selected2: false,
				type: 0, //0全部，1云端，2本地
				selectShow: false, //控制下拉列表的显示隐藏，false隐藏、true显示
				selectData: [], //下拉列表的数据
				index: 0, //选择的下拉列表下标
				classifyId: app.globalData.classifyId,
				rawid: 0, //素材id
				rawtypeid: 0, //素材类型id
				itemsIndex: 0, //items下标
				itemIndex: 0, //素材下标
				showId: '', //默认选择的素材
				notScanCode: true,
				isShowLocalIp: true,
				localIP: '',
				hudongIp: '',
				isVerticalScreen: true, //是否是竖屏状态
				appType: ''
			}
		},
		/**
		 * 生命周期函数--监听页面加载
		 */
		onLoad: function(options) {


			this.appType = uni.getSystemInfoSync().platform;

			// 获取小程序用户信息
			if (app.globalData.id === -1) {
				uni.request({
					url: app.globalData.baseURL + '/wx/user/info',
					method: "get",
					data: {
						"sessionKey": app.globalData.sessionKey,
						"signature": app.globalData.signature,
						"rawData": app.globalData.rawData,
						"iv": app.globalData.iv,
						"encryptedData": app.globalData.encryptedData,
						"appid": utils.getMiniAppInfo()
					},
					header: {
						'content-type': 'application/json'
					},
					success: function(res) {
						// console.log(res, '------------获取小程序用户信息---------');
						// let data = JSON.parse(res.data);
						// console.log(data,'data')
					}
				});
			}
		},
		onShow: function() {
			console.log('onShow');
			// console.log(app.globalData.userInfo);
			// this.createConnect();
			//#ifdef APP-PLUS
			// 解除屏幕方向锁定，恢复到应用的默认值
			plus.screen.unlockOrientation();
			//#endif 

		},
		onHide: function() {
			console.log("onhide");
			// clearInterval(timer);
			// uni.closeSocket();
		},
		onUnload: function() {
			console.log("onUnload");
			// clearInterval(timer);
			// uni.closeSocket();
		},
		created() {
			this.createConnect();
			uni.showLoading({
				title: '加载中...',
			})
		},
		mounted() {},
		methods: {
			onResize() { //获取横竖屏状态
				uni.getSystemInfo({
					success: (res) => {
						console.log(res.windowWidth);
						console.log(res.windowHeight);
						if (res.windowWidth > res.windowHeight) {
							// console.log('横屏');
							this.isVerticalScreen = false;
						} else {
							// console.log('竖屏');
							this.isVerticalScreen = true;
						}
					}
				});
			},
			createConnect() { //连接
				page = 1;
				hadLastPage = false;

				var connectData = utils.getStor('connectData') || '';
				console.log("ip:" + connectData);
				if (connectData == '' || connectData == undefined) {
					this.setData({
						items: []
					});
					if (this.notScanCode) {
						uni.showToast({
							title: '登录可能已过期,请尝试重新扫码登录~',
							icon: "none",
							duration: 2000
						});
					}
					this.setData({
						notScanCode: true
					});
					return;
				} else {
					this.setData({
						ip: connectData
					});
					console.log("☆☆☆☆☆连接登陆☆☆☆☆☆", app.globalData.loginType);
					let loginInfo = {
						"command": 'login',
						"nickName": String(app.globalData.userInfo.nickName),
						"avatarUrl": app.globalData.userInfo.avatarUrl == undefined ? '' : String(app.globalData.userInfo.avatarUrl),
						"type": String(app.globalData.loginType)
					}
					console.log(loginInfo, 'loginInfo')

					http.httpRequest(loginInfo).then(res => {
						this.returnResult(res);
					}, error => {
						console.log(error);
					})


					//获取幕布号
					let data = {
						"command": "getsetting",
						"queryAll": "1"
					}

					http.httpRequest(data).then(res => {
						this.returnResult(res);
					}, error => {
						console.log(error);
					})

					//获取分类
					let dataMsg = {
						"command": "getAllClassify",
						"mubuIndex": String(app.globalData.mubuIndex)
					}
					http.httpRequest(dataMsg).then(res => {
						this.returnResult(res);
					}, error => {
						console.log(error);
					})


					this.getMaterials(this.state); //全部素材
				}
			},
			setData(obj) { //转换this.xxx = xxxx
				const keys = Object.keys(obj);
				keys.forEach((key) => {
					this[key] = obj[key];
				});
			},
			getMaterials(state) { //获取素材
				// 显示加载图标
				uni.showNavigationBarLoading();

				if (hadLastPage != false) {
					uni.hideNavigationBarLoading();
					uni.showToast({
						title: '没有加载的数据了',
						icon: 'none'
					});
					return;
				}

				var data = {};
				data.command = "getsrc";
				data.type = '1'; //1-素材、2-场景、3-霸屏、
				data.classify = String(app.globalData.classifyId); //-1-代表全部、注意：霸屏时填写-1
				data.current = String(page); //请求第几页数据
				data.size = '8'; //每页请求数量
				data.state = String(state); //-1-全部、0-未下载、1-已下载、
				data.mubuIndex = String(app.globalData.mubuIndex); //幕布索引
				data.dataStatus = '0'; //资源删除状态：-1-删除、0-正常、1-全部
				data.searchCondition = ''; //按照名称或编号模糊查询
				console.log(data, '------------getsrc------------------');

				http.httpRequest(data).then(res => {
					this.returnResult(res)
				}, error => {
					console.log(error);
				})
			},
			// 下载素材
			downraw(e) {
				var items = e.currentTarget.dataset.items;
				var itemsIndex = e.currentTarget.dataset.index;

				console.log(e.currentTarget.dataset.items, '选中素材');

				this.setData({
					itemsIndex: itemsIndex,
					showId: items.kid
				});

				var data = {};
				data.command = "changresstate";
				data.id = String(items.kid);
				data.type = "1";
				data.mubuIndex = String(app.globalData.mubuIndex)
				if (items.state == 0) {
					//未下载，先下载
					http.httpRequest(data).then(res => {
						console.log(res, 'http获取到的数据');
						uni.showToast({
							title: '下载中,请稍后...',
							icon: "none",
							duration: 2000
						})
						setTimeout(() => {
							this.returnResult(res)
						}, 1000)
					}, error => {
						console.log(error);
					})
				} else if (items.state == 1) {
					var data = { //更改后
						command: "playMaterial",
						mubuIndex: String(app.globalData.mubuIndex),
						classifyLabel: String(items.classifyLabel),
						no: String(items.no)
					};

					// console.log(data, "播放素材");
					if ((app.globalData.type == 1 && app.globalData.id != items.kid) || (app.globalData.type != 1)) {
						materialId = items.kid;
						http.httpRequest(data).then(res => {
							console.log(res, 'http获取到的数据');
							this.returnResult(res)
						}, error => {
							console.log(error);
						})
					} else {
						var olddate = app.globalData.olddate;
						var nowdate = new Date().getTime();
						var diff = nowdate - olddate;
						if (diff > 3000) {
							materialId = items.kid;
							http.httpRequest(data).then(res => {
								console.log(res, 'http获取到的数据');
								this.returnResult(res)
							}, error => {
								console.log(error);
							})
						}
					}
				} else {
					//下载中
					uni.showToast({
						title: '下载中,请稍后...',
						icon: "none",
						duration: 2000
					})
				}
			},
			selectedFn(e) { //全部
				this.setData({
					selected: true,
					selected1: false,
					selected2: false,
					state: -1
				});
				// console.log("查询全部素材");
				page = 1;
				hadLastPage = false;
				this.getMaterials(this.state); //全部素材
			},
			selected1Fn(e) { //云端
				this.setData({
					selected: false,
					selected1: true,
					selected2: false,
					state: 0
				});
				console.log("查询云端素材");
				page = 1;
				hadLastPage = false;
				this.getMaterials(this.state); //云端素材
			},
			selected2Fn(e) { //本地
				this.setData({
					selected: false,
					selected1: false,
					selected2: true,
					state: 1
				});
				console.log("查询本地素材");
				page = 1;
				hadLastPage = false;
				this.getMaterials(this.state); //本地素材
			},
			// 点击下拉显示框
			selectTap() {
				this.setData({
					selectShow: !this.selectShow
				});
			},
			selectClick: function(res) {
				//获取点击事件的信息
				let clickInfo = res
				console.log(clickInfo);
				this.setData({
					classifyId: clickInfo.id,
					selectShow: !this.selectShow
				});
				app.globalData.classifyId = this.classifyId;
				page = 1;
				hadLastPage = false;
				this.getMaterials(this.state);
			},
			returnResult(res) { //http返回结果

				let that = this;
				// console.log(res,'res')
				// var jsonObj = JSON.parse(res.data);
				if (res == undefined) {
					uni.showToast({
						title: '登录可能已过期,请尝试重新扫码登录~',
						icon: "none",
						duration: 2000
					});
					return false;
				}

				if (res.data != undefined) {
					var jsonObj = res.data;
					console.log(jsonObj, '收到服务器内容');

					//下载中
					if (jsonObj.command == "changresstate" && jsonObj.type == 1) {

						var id = jsonObj.id;
						var data = that.items;

						for (let i = 0; i < data.length; i++) {
							if (data[i].kid == id) {
								var state = 'items[' + i + '].state';
								if (jsonObj.state == 1) {
									setTimeout(function() {
										data[i].state = jsonObj.state;
									}, 1500);
								} else {
									data[i].state = jsonObj.state;
								}
								break;
							}
						}
					} else if (jsonObj.command == 'playMaterial') {
						if (jsonObj.result == "FAILED") {
							utils.showErrorMsgFun(jsonObj, false);
						}
						return;
					} else if (jsonObj.command == "sendctrl") {
						if (jsonObj.result == "FAILED") {
							utils.showErrorMsgFun(jsonObj);
						} else {
							app.globalData.olddate = new Date().getTime();
							app.globalData.type = 1;
							app.globalData.id = materialId;
						}
						return;
					} else if (jsonObj.command == "login") {
						uni.hideLoading()
						if (jsonObj.result == "SUCCESS") {

						} else {
							utils.showErrorMsgFun(jsonObj);
						}
					} else if (jsonObj.command == "getAllClassify") {
						if (jsonObj.result == "SUCCESS") {
							let classify = []
							let items = [{
								"id": -1,
								"text": "全部分类"
							}];
							if (jsonObj.datas != undefined) {
								var arr = jsonObj.datas;
								classify = arr.map((item) => {
									let json = {};
									json.id = item.classify;
									json.text = item.classifyName;
									return json;
								});
								classify.forEach((item, classify) => {
									items.push(item);
								})
								that.setData({
									selectData: items,

								})
								app.globalData.fuseClassifyLabel = jsonObj.mubuConf
							}
						} else {
							utils.showErrorMsgFun(jsonObj);
						}

					} else if (jsonObj.command == "getsrc") {
						uni.hideLoading()
						if (jsonObj.result == "SUCCESS") {
							if (jsonObj.datas) {
								var data = jsonObj.datas;
								var item = page > 1 ? that.items : [];

								data.forEach((items, index, arr) => {
									var base64 = items.imageContent;
									if (base64 != null) {
										items.imageContent = base64.replace(/[\r\n]/g, "");
									}
									item.push(items);
								});
								that.setData({
									items: item
								});
								if (data.length > 0) {
									page++;
								} else {
									hadLastPage = true;
								}
								uni.hideNavigationBarLoading();
							}
						} else {
							utils.showErrorMsgFun(jsonObj);
						}
					} else if (jsonObj.command == "getsetting") {
						if (jsonObj.result == "SUCCESS") {
							app.globalData.mainMubuNo = jsonObj.mainMuBuNo;
							app.globalData.series = jsonObj.series
						}
					} else if (jsonObj.command == "hudong" && jsonObj.result == 'SUCCESS') { //互动服务器
						uni.showToast({
							title: '操作成功～',
							icon: 'none'
						})
					}
				}

			},
			menuItemSendHttp(data) { //搜索菜单发送请求
				http.httpRequest(data).then(res => {
					console.log(res, 'http获取到的数据');
					this.returnResult(res)
				}, error => {
					console.log(error);
				})
			},
			menuItemClick: function(res) {
				// console.log(res, '--------res-------')
				//获取点击事件的信息
				let clickInfo = res;
				// console.log(clickInfo);
				// 根据不同类型进行判别处理
				//事件的处理 代码
				switch (clickInfo.id) {
					case "1":
						let volUp = {
							command: "vol",
							mubuIndex: String(app.globalData.mubuIndex),
							type: '0',
							ctl: '0'
						}
						this.menuItemSendHttp(volUp);
						break;
					case "2":
						let volDown = {
							command: "vol",
							mubuIndex: String(app.globalData.mubuIndex),
							type: '0',
							ctl: '1'
						}
						this.menuItemSendHttp(volDown);
						break;
					case "3":
						if (clickInfo.isPlayVideo) { //播放
							let play = {
								command: "vol",
								mubuIndex: String(app.globalData.mubuIndex),
								type: '1',
								ctl: '1'
							}
							this.menuItemSendHttp(play);
						} else { //暂停
							let pause = {
								command: "vol",
								mubuIndex: String(app.globalData.mubuIndex),
								type: '1',
								ctl: '0'
							}
							this.menuItemSendHttp(pause);
						}
						break;
					case "5":
						let pause = {
							command: "sendctrl",
							v: '43',
							d: JSON.stringify({
								k1: String(app.globalData.mubuIndex),
								k2: '1'
							})
						}
						this.menuItemSendHttp(pause);
						break;
					case "6":
						this.setData({
							notScanCode: false
						});

						//#ifdef MP-WEIXIN
						app.globalData.loginType = 0;
						//#endif 

						//#ifdef APP-PLUS
						app.globalData.loginType = 1;
						//#endif 

						uni.scanCode({
							success: (res) => {
								let arr = [];
								if (res.result.indexOf("http://mp2") == 0) {
									arr = res.result.split("=")[1].split(",");
								} else {
									arr = res.result.split(",");
								}
								console.log(arr);
								if (arr.length > 1) {
									app.globalData.mubuIndex = arr[1];
									utils.setStor('connectData', arr[0]);
									uni.setStorageSync('mubuIndex', arr[1]);

								} else {
									app.globalData.mubuIndex = 0;
									utils.setStor('connectData', arr);
									uni.setStorageSync('mubuIndex', 0);
								}
								this.setData({
									ip: utils.getStor('connectData'),
									items: []
								});
								// uni.closeSocket()
								this.createConnect();
							},
							fail: (res) => {
								uni.showToast({
									title: '扫码失败~',
									icon: 'none',
									duration: 2000
								})
							},
							complete: (res) => {}
						});
						break;
					case "7":
						if (app.globalData.mainMubuNo == 1) {
							uni.showToast({
								title: '暂无操作权限~',
								icon: 'none'
							})
						} else {
							let bg = {
								command: "sendctrl",
								v: '43',
								d: JSON.stringify({
									k1: String(app.globalData.mubuIndex),
									k2: '0'
								})
							}
							this.menuItemSendHttp(bg);
						}
						break;
					case "8": //控制按钮
						let serverIP = '';
						//#ifdef MP-WEIXIN
						uni.showToast({
							title: '暂时无法使用~',
							icon: 'none'
						})
						//#endif 

						//#ifdef APP-PLUS
						this.$refs.pwd.pwdDialog = 'Modal'
						serverIP = uni.getStorageSync('zkLocalIP') || '';
						if (serverIP == '' || serverIP == undefined) {
							this.localIP = serverIP
						} else {
							this.localIP = serverIP
						}
						//#endif 
						break;
					case "9": //互动
						this.$refs.hudong.modalName = 'modal';
						this.hudongIp = uni.getStorageSync('hudongIp') || '';
						break;
					case "10": //关于
						this.$refs.about.modalName = 'modal'
						break;
				}
			},
		},
		/**
		 * 页面相关事件处理函数--监听用户下拉动作
		 */
		onPullDownRefresh: function() {
			console.log("执行下拉");
			page = 1;
			hadLastPage = false;
			this.setData({
				items: []
			});

			this.getMaterials(this.state);

			// 隐藏导航栏加载框
			uni.hideNavigationBarLoading();

			uni.stopPullDownRefresh();
			uni.showLoading({
				title: '加载中...',
				// mask: true
			})
		},
		/**
		 * 页面上拉触底事件的处理函数
		 */
		onReachBottom: function() {
			console.log("执行上拉");
			this.getMaterials(this.state);
		},
	}
</script>
<style lang="scss">
	page {
		background-color: #313247;
	}
</style>
<style scoped>
	.schoollist {
		padding-top: 98rpx;
		padding-bottom: 150rpx;
	}

	.school-list-item {
		background-color: #3A3A52;
		width: 100%;
		margin-top: 10rpx;
		margin-bottom: 20rpx;
		display: flex;
		flex-wrap: nowrap;
	}

	.school-list-info {
		position: relative;
		width: 40%;
		margin: 40rpx 40rpx 20rpx 40rpx;
		border-radius: 8rpx;
		text-align: center;
	}

	.school-list-photo,
	.school-list-photo-Selected {
		width: 100%;
		height: 180rpx;
		border: 4rpx solid #666;
		border-radius: 8rpx;
		vertical-align: middle;
		box-sizing: border-box;
	}

	.school-list-photo-Selected {
		border: 4rpx solid #ffe570;
	}

	.school-list-photo-up {
		position: absolute;
		z-index: 1;
		top: 0;
		left: 0;
		background: rgba(0, 0, 0, .6);
		display: flex;
		align-items: center;
		justify-content: center;
	}

	.school-list-notLoad {
		color: #fff;
		font-size: 30rpx;
	}

	.school-list-desc {
		display: block;
		color: #fff;
		text-align: center;
		font-size: 25rpx;
		padding: 10rpx;
	}

	/* 下拉 */
	.select_box {
		border-radius: 14rpx;
		position: relative;
		line-height: 100rpx;
		flex: 1.5;
		color: #fff;
		font-size: 36rpx;
		display: flex;
		justify-content: space-around;
		align-items: center;
	}

	.select_box .select {
		box-sizing: border-box;
		height: 40rpx;
		width: 180rpx;
		display: flex;
		align-items: center;
		justify-content: center;
		padding: 0 20rpx;
		background-color: #ffffff;
		position: relative;
		margin-top: 4rpx;
	}

	.select_box .select .select_text {
		font-size: 34rpx;
		color: #3A3A52;
		line-height: 34rpx;
		text-align: center;
	}

	.select_box .select .select_img {
		width: 30rpx;
		height: 30rpx;
		display: block;
		transition: transform 0.3s;
		position: absolute;
		right: 20rpx;
	}

	.select_box .select .select_img_rotate {
		transform: rotate(180deg);
	}

	.select_box .option_box {
		position: absolute;
		top: 66rpx;
		right: 19rpx;
		width: 180rpx;
		height: 0;
		overflow-y: auto;
		transition: height 0.3s;
		text-align: center;
	}

	.select_box .option_box .option {
		display: block;
		height: 40rpx;
		line-height: 40rpx;
		font-size: 34rpx;
		border-top: 2rpx solid #3A3A52;
		background-color: #ffffff;
		color: #313247;
		box-sizing: border-box;
	}

	.nav {
		width: 100%;
		height: 90rpx;
		display: flex;
		flex-direction: row;
		color: #ffffff;
		background-color: #3A3A52;
		position: fixed;
		top: 0rpx;
		z-index: 2;
	}

	.default {
		line-height: 90rpx;
		text-align: center;
		flex: 1;
		color: #fff;
		font-size: 36rpx;
	}

	.yellow {
		line-height: 90rpx;
		text-align: center;
		color: #FFE570;
		flex: 1;
		font-size: 36rpx;
	}

	.show {
		display: block;
		widows: 750rpx;
	}

	.hidden {
		display: none;
		widows: 750rpx;
	}

	.img-size .school-list-photo,
	.img-size .school-list-photo-Selected {
		/* height: 220rpx !important; */
	}

	@media screen and (min-width: 769px) {
		.nav {
			height: 60rpx !important;
		}

		.nav view {
			font-size: 22px !important;
			line-height: 60rpx !important;
		}

		.nav .default {
			line-height: 60rpx !important;
		}

		.school-list-item {
			margin-bottom: 0 !important;
		}

		.img-size .school-list-photo,
		.img-size .school-list-photo-Selected {
			height: 220rpx !important;
		}

		.schoollist {
			padding-top: 68rpx !important;
		}

		.school-list-info {
			width: 45% !important;
			margin: 30rpx 30rpx 10rpx 30rpx !important;
		}
	}

	@media screen and (min-device-width: 641px) and (max-device-width: 768px) {
		.nav {
			height: 60rpx !important;
		}

		.nav view {
			font-size: 22px !important;
			line-height: 60rpx !important;
		}

		.nav .default {
			line-height: 60rpx !important;
		}

		.school-list-item {
			margin-bottom: 0 !important;
		}

		.img-size .school-list-photo {
			height: 220rpx !important;
		}

		.schoollist {
			padding-top: 68rpx !important;
		}

		.school-list-info {
			width: 50% !important;
			margin: 30rpx 30rpx 10rpx 30rpx !important;
		}
	}


	@media screen and (min-device-width: 401px) and (max-device-width: 640px) {
		.schoollist {
			padding-top: 98rpx;
			padding-bottom: 150rpx;
		}

		.school-list-item {
			background-color: #3A3A52;
			width: 100%;
			margin-top: 10rpx;
			margin-bottom: 20rpx;
			display: flex;
			flex-wrap: nowrap;
		}

		.school-list-info {
			position: relative;
			width: 40%;
			margin: 40rpx 40rpx 20rpx 40rpx;
			border-radius: 8rpx;
			text-align: center;
		}

		.school-list-photo,
		.school-list-photo-Selected {
			width: 100%;
			height: 180rpx;
			border: 4rpx solid #666;
			border-radius: 8rpx;
			vertical-align: middle;
			box-sizing: border-box;
		}

		.school-list-photo-Selected {
			border: 4rpx solid #ffe570;
		}

		.school-list-photo-up {
			position: absolute;
			z-index: 1;
			top: 0;
			left: 0;
			background: rgba(0, 0, 0, .6);
			display: flex;
			align-items: center;
			justify-content: center;
		}

		.school-list-notLoad {
			color: #fff;
			font-size: 30rpx;
		}

		.school-list-desc {
			display: block;
			color: #fff;
			text-align: center;
			font-size: 25rpx;
			padding: 10rpx;
		}

		/* 下拉 */
		.select_box {
			border-radius: 14rpx;
			position: relative;
			line-height: 100rpx;
			flex: 1.5;
			color: #fff;
			font-size: 36rpx;
			display: flex;
			justify-content: space-around;
			align-items: center;
		}

		.select_box .select {
			box-sizing: border-box;
			height: 40rpx;
			width: 180rpx;
			display: flex;
			align-items: center;
			justify-content: center;
			padding: 0 20rpx;
			background-color: #ffffff;
			position: relative;
			margin-top: 4rpx;
		}

		.select_box .select .select_text {
			font-size: 34rpx;
			color: #3A3A52;
			line-height: 34rpx;
			text-align: center;
		}

		.select_box .select .select_img {
			width: 30rpx;
			height: 30rpx;
			display: block;
			transition: transform 0.3s;
			position: absolute;
			right: 20rpx;
		}

		.select_box .select .select_img_rotate {
			transform: rotate(180deg);
		}

		.select_box .option_box {
			position: absolute;
			top: 66rpx;
			right: 19rpx;
			width: 180rpx;
			height: 0;
			overflow-y: auto;
			transition: height 0.3s;
			text-align: center;
		}

		.select_box .option_box .option {
			display: block;
			height: 40rpx;
			line-height: 40rpx;
			font-size: 34rpx;
			border-top: 2rpx solid #3A3A52;
			background-color: #ffffff;
			color: #313247;
			box-sizing: border-box;
		}

		.nav {
			width: 100%;
			height: 90rpx;
			display: flex;
			flex-direction: row;
			color: #ffffff;
			background-color: #3A3A52;
			position: fixed;
			top: 0rpx;
			z-index: 2;
		}

		.default {
			line-height: 90rpx;
			text-align: center;
			flex: 1;
			color: #fff;
			font-size: 36rpx;
		}

		.yellow {
			line-height: 90rpx;
			text-align: center;
			color: #FFE570;
			flex: 1;
			font-size: 36rpx;
		}

		.show {
			display: block;
			widows: 750rpx;
		}

		.hidden {
			display: none;
			widows: 750rpx;
		}
	}

	@media only screen and (max-device-width: 400px) {
		.schoollist {
			padding-top: 98rpx;
			padding-bottom: 150rpx;
		}

		.school-list-item {
			background-color: #3A3A52;
			width: 100%;
			margin-top: 10rpx;
			margin-bottom: 20rpx;
			display: flex;
			flex-wrap: nowrap;
		}

		.school-list-info {
			position: relative;
			width: 40%;
			margin: 40rpx 40rpx 20rpx 40rpx;
			border-radius: 8rpx;
			text-align: center;
		}

		.school-list-photo,
		.school-list-photo-Selected {
			width: 100%;
			height: 180rpx;
			border: 4rpx solid #666;
			border-radius: 8rpx;
			vertical-align: middle;
			box-sizing: border-box;
		}

		.school-list-photo-Selected {
			border: 4rpx solid #ffe570;
		}

		.school-list-photo-up {
			position: absolute;
			z-index: 1;
			top: 0;
			left: 0;
			background: rgba(0, 0, 0, .6);
			display: flex;
			align-items: center;
			justify-content: center;
		}

		.school-list-notLoad {
			color: #fff;
			font-size: 30rpx;
		}

		.school-list-desc {
			display: block;
			color: #fff;
			text-align: center;
			font-size: 25rpx;
			padding: 10rpx;
		}

		/* 下拉 */
		.select_box {
			border-radius: 14rpx;
			position: relative;
			line-height: 100rpx;
			flex: 1.5;
			color: #fff;
			font-size: 36rpx;
			display: flex;
			justify-content: space-around;
			align-items: center;
		}

		.select_box .select {
			box-sizing: border-box;
			height: 40rpx;
			width: 180rpx;
			display: flex;
			align-items: center;
			justify-content: center;
			padding: 0 20rpx;
			background-color: #ffffff;
			position: relative;
			margin-top: 4rpx;
		}

		.select_box .select .select_text {
			font-size: 34rpx;
			color: #3A3A52;
			line-height: 34rpx;
			text-align: center;
		}

		.select_box .select .select_img {
			width: 30rpx;
			height: 30rpx;
			display: block;
			transition: transform 0.3s;
			position: absolute;
			right: 20rpx;
		}

		.select_box .select .select_img_rotate {
			transform: rotate(180deg);
		}

		.select_box .option_box {
			position: absolute;
			top: 66rpx;
			right: 19rpx;
			width: 180rpx;
			height: 0;
			overflow-y: auto;
			transition: height 0.3s;
			text-align: center;
		}

		.select_box .option_box .option {
			display: block;
			height: 40rpx;
			line-height: 40rpx;
			font-size: 34rpx;
			border-top: 2rpx solid #3A3A52;
			background-color: #ffffff;
			color: #313247;
			box-sizing: border-box;
		}

		.nav {
			width: 100%;
			height: 90rpx;
			display: flex;
			flex-direction: row;
			color: #ffffff;
			background-color: #3A3A52;
			position: fixed;
			top: 0rpx;
			z-index: 2;
		}

		.default {
			line-height: 90rpx;
			text-align: center;
			flex: 1;
			color: #fff;
			font-size: 36rpx;
		}

		.yellow {
			line-height: 90rpx;
			text-align: center;
			color: #FFE570;
			flex: 1;
			font-size: 36rpx;
		}

		.show {
			display: block;
			widows: 750rpx;
		}

		.hidden {
			display: none;
			widows: 750rpx;
		}
	}
</style>
